package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /*
    *根据菜品ID查询套餐ID
    * */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

//     插入套餐及其相关菜品
    void insertBatch(List<SetmealDish> setmealDishes);

//    删除套餐相关的菜品信息
    void deleteByIds(List<Long> setmealIds);

//    根据套餐ID查询和其相联菜品和套餐信息
    @Select("select * from setmeal_dish where setmeal_id = #{setmealId}")
    List<SetmealDish> getBySetmealId(Long setmealId);

//    根据套餐ID删除相关联的菜品套餐信息
    @Delete("delete from setmeal_dish where setmeal_id = #{setmealId}")
    void deleteBySetmealId(Long setmealId);
}
